package com.thinqq.web.client.content.painter;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
import com.thinqq.web.client.ThinqQImageBundle;
import com.thinqq.web.client.constants.CSSConstants;
import com.thinqq.web.client.content.SIIS;

public class SIISContentPainter implements IContentPainter {

	@Override
	public void updateConent(HorizontalPanel mainContent,
			VerticalPanel relatedContent) {
		updateMainAreaContent(mainContent,relatedContent);
	}

	private void updateMainAreaContent(HorizontalPanel mainContent,
			VerticalPanel relatedContent) {		
		mainContent.clear();
		FlowPanel mainpanel = new FlowPanel();
		SIIS content = GWT.create(SIIS.class);
		ThinqQImageBundle imageBundle = GWT.create(ThinqQImageBundle.class);
		Label title = new Label(content.siisHead());
		title.setStyleName(CSSConstants.CSS_MAIN_CONTENT_TITLE);
		mainpanel.setStyleName(CSSConstants.MAIN_CONTENT_COMMON_STYLE);
		mainpanel.add(title);
		FlowPanel siisContentPanel = new FlowPanel();
		siisContentPanel.add(new Label(content.siisIntro1()));		
		siisContentPanel.add(new Label(content.siisIntro2()));
		HorizontalPanel hPanel = new HorizontalPanel();
		Image siisImage = new Image(imageBundle.getSIISImage());
		siisImage.setStyleName(CSSConstants.CENTER_STYLE);
		hPanel.add(siisImage);
		hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		VerticalPanel vPanel = new VerticalPanel();		
		Label siisSystems = new Label(content.siisSystems());
		siisSystems.addStyleName(CSSConstants.UNORDERED_BULLET);
		siisSystems.addStyleName(CSSConstants.SUB_TITLE);
		vPanel.add(siisSystems);
		Label siisSystemsOneLiner = new Label(content.siisSystemsOneLiner());
		siisSystemsOneLiner.addStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		vPanel.add(siisSystemsOneLiner);
		Label siisCoreInterface = new Label(content.siisCoreInterfaceModule());		
		siisCoreInterface.addStyleName(CSSConstants.UNORDERED_BULLET);
		siisCoreInterface.addStyleName(CSSConstants.SUB_TITLE);
		vPanel.add(siisCoreInterface);
		Label siisCoreInterfaceOneLiner = new Label(content.siisCoreInterfaceModuleOneLiner());
		siisCoreInterfaceOneLiner.addStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		vPanel.add(siisCoreInterfaceOneLiner);		
		hPanel.add(vPanel);
		siisContentPanel.add(hPanel);
		siisContentPanel.add(new Label(content.siisConcepts()));
		Label siisConcept1 = new Label(content.siisConcept1());				
		siisConcept1.addStyleName(CSSConstants.SUB_TITLE);
		siisConcept1.addStyleName(CSSConstants.UNORDERED_BULLET);
		siisContentPanel.add(siisConcept1);
		Label siisConcept1a = new Label(content.siisConcept1a());
		siisConcept1a.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		siisContentPanel.add(siisConcept1a);
		Label siisConcept1b = new Label(content.siisConcept1b());
		siisConcept1b.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		siisContentPanel.add(siisConcept1b);
		Label siisConcept1c = new Label(content.siisConcept1c());
		siisConcept1c.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		siisContentPanel.add(siisConcept1c);
		Label siisConcept1d = new Label(content.siisConcept1d());
		siisConcept1d.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);								
		siisContentPanel.add(siisConcept1d);
		Label siisConcept2 = new Label(content.siisConcept2());		
		siisConcept2.addStyleName(CSSConstants.UNORDERED_BULLET);
		siisConcept2.addStyleName(CSSConstants.SUB_TITLE);
		Label siisConcept2a = new Label(content.siisConcept2a());
		siisConcept2a.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		Label siisConcept2b = new Label(content.siisConcept2b());
		siisConcept2b.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);
		Label siisConcept2c = new Label(content.siisConcept2c());
		siisConcept2c.setStyleName(CSSConstants.UNORDERED_BULLET_LEVEL_1);		
		siisContentPanel.add(siisConcept2);
		siisContentPanel.add(siisConcept2a);
		siisContentPanel.add(siisConcept2b);
		siisContentPanel.add(siisConcept2c);
		siisContentPanel.add(new Label(content.siisVerdict()));		
		mainpanel.add(siisContentPanel);
		mainContent.add(mainpanel);
	}

}
